<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>5.清除浮动对元素的影响</title>
  <style>
    div {
      width: 200px;
      height: 200px;
  
    }
  
    main {
      border: solid 3px black;
      height: 220px;
      width: 620px;
      margin: 0 auto;
      padding: 20px;
  
    }
  
   div.red {
     border: solid 2px red;
     float: left;
   }
  
   div.green {
     border: solid 2px green;
     float: right;
   }
  
   div.blue {
     border: solid 2px blue;
     clear: both;
     
   }
  </style>
  </head>
  
  <body>
    <main>
      <div class="red"></div>
      <div class="green"></div>
      <div class="blue"></div>
    </main>
  </body>
  
  </html>